<?php

namespace Parser;


class Enquiry
{
    private $total = '0';

    private $TCITotal = '0';

    private $TCIPremium = '0';

    private $VCITotal = '0';

    private $VCIPremium = '0';

    private $taxTotal = '0';

    private $taxPremium = '0';

    private $VCICoverages = [];

    private $VCIDiscount = '0';

    private $repetition = '';

    //自主定价系数
    private $independentPriceRatio = '';

    private $status;

    private $errorTip;

    //NCD系数(无赔款优待系数)
    private $NCDRate;

    /**
     * @param $taxTotal
     */
    public function setTaxTotal($taxTotal): void
    {
        $this->taxTotal = (string)$taxTotal;
    }

    /**
     * @param string $total
     */
    public function setTotal(string $total = '0'): void
    {
        $this->total = $total;
        $this->total = bcadd(bcadd($this->VCITotal, $this->TCITotal, 2), $this->taxTotal, 2);
    }

    /**
     * @param string $repetition
     */
    public function setRepetition(string $repetition): void
    {
        $this->repetition = $repetition;
    }

    public function setTaxPremium($taxPremium): void
    {
        $this->taxPremium = (string)$taxPremium;
    }

    public function setTCIPremium($TCIPremium): void
    {
        $this->TCIPremium = (string)$TCIPremium;
    }

    public function TCIPremiumAppend($TCIPremium)
    {
        $TCIPremium = number_format($TCIPremium, 2, '.', '');

        $this->TCIPremium = bcadd($this->TCIPremium, (string)$TCIPremium, 2);
    }

    public function setTCITotal($TCITotal): void
    {
        $this->TCITotal = (string)$TCITotal;
    }

    /**
     * @param array $VCICoverages
     */
    public function setVCICoverages(array $VCICoverages): void
    {
        $this->VCICoverages[] = $VCICoverages;
    }

    public function setVCIPremium($VCIPremium): void
    {
        $this->VCIPremium = (string)$VCIPremium;
    }

    public function setErrorTip($errorTip)
    {
        $this->errorTip = $errorTip;
    }

    public function VCIPremiumAppend($VCIPremium)
    {
        $VCIPremium = number_format($VCIPremium, 2, '.', '');

        $this->VCIPremium = bcadd($this->VCIPremium, (string)$VCIPremium, 2);
    }

    public function setVCITotal($VCITotal): void
    {
        $VCITotal = number_format($VCITotal, 2, '.', '');

        $this->VCITotal = (string)$VCITotal;
    }

    public function VCITotalAppend($VCITotal)
    {
        $this->VCITotal = bcadd($this->VCITotal, (string)$VCITotal, 2);

    }

    public function setVCIDiscount($VCIDiscount): void
    {
        $this->VCIDiscount = (string)$VCIDiscount;
    }

    public function setIndependentPriceRatio($independentPriceRatio): void
    {
        $this->independentPriceRatio = $independentPriceRatio;
    }
    public function setNCDRate($NCDRate): void
    {
        $this->NCDRate = $NCDRate;
    }

    public function getNCDRate(): string
    {
        return $this->NCDRate;
    }

    /**
     * @return string
     */
    public function getVCIPremium(): string
    {
        return $this->VCIPremium;
    }

    /**
     * @return string
     */
    public function getVCITotal(): string
    {
        return $this->VCITotal;
    }

    public function success(): void
    {
        $this->status = 'SUCCESS';
    }

    public function failure()
    {
        $this->status = 'FAILED';
    }

    /**
     * @return array
     * Author ls
     */
    public function get(): array
    {
        $vars = get_class_vars(get_class($this));

        foreach ($vars as $key => &$var) {
            $var = $this->$key;
        }
        return $vars;
    }

    /**
     * @param mixed $independentPriceRatio
     */


}
